import React from 'react';
import { connect } from 'dva';
import CommonBillComponent from '../../components/CommonBill/CommonBill';

function CommonBill({ dispatch, app, content }) {
  function backPane(panes, currentPane) {
    dispatch({ type: 'app/backPane', payload: { panes, currentPane } });
  }
  const commonBillProps = {
    app,
    content,
    dispatch,
    onRemovePane: backPane,
  };

  return (
    <CommonBillComponent {...commonBillProps} />
  );
}

export default connect(({ app, content }) =>
  ({ app, content }))(CommonBill);
